var xhReq;
//var timerID = setInterval(DoHttp(), 4000);
var responseText = DoHttp(getQueryVariable("dataUri"));//eg. "/TemperatureLog_2012-5.txt"
var returnResult = LoadTemperatureFile(responseText);
var series0Data = this.returnResult[0];//new Array();//
var series1Data = this.returnResult[1];//new Array();//
var series2Data = this.returnResult[2];//new Array();//
// var tempChart;
					// this.series1Data = [
							// [Date.UTC(2010,  9,  9), 0 ],
							// [Date.UTC(2010,  9, 14), 0.15],
							// [Date.UTC(2010, 10, 28), 0.35],
							// [Date.UTC(2010, 11, 12), 0.46],
							// [Date.UTC(2011,  0,  1), 0.59],
							// [Date.UTC(2011,  0, 24), 0.58],
							// [Date.UTC(2011,  1,  1), 0.62],
							// [Date.UTC(2011,  1,  7), 0.65],
							// [Date.UTC(2011,  1, 23), 0.77],
							// [Date.UTC(2011,  2,  8), 0.77],
							// [Date.UTC(2011,  2, 14), 0.79],
							// [Date.UTC(2011,  2, 24), 0.86],
							// [Date.UTC(2011,  3,  4), 0.8 ],
							// [Date.UTC(2011,  3, 18), 0.94],
							// [Date.UTC(2011,  3, 24), 0.9 ],
							// [Date.UTC(2011,  4, 16), 67.39],
							// [Date.UTC(2011,  4, 21), 0   ]
						// ];

var chart;
			$(document).ready(function() {
				chart = new Highcharts.Chart({
					chart: {
						renderTo: 'container',
						type: 'spline'
					},
					title: {
						text: 'House Temperature'
					},
					subtitle: {
						text: ''	
					},
					xAxis: {
						type: 'datetime',
						dateTimeLabelFormats: { // don't display the dummy year
							month: '%e. %b',
							year: '%b'
						}
					},
					yAxis: {
						title: {
							text: 'Temp (C)'
						},
						min: 0
					},
					tooltip: {
						formatter: function() {
				                return '<b>'+ this.series.name +'</b><br/>'+
//								Highcharts.dateFormat('%e. %b', this.x) +': '+ this.y +' c';// not sure where this format comes from
								Highcharts.dateFormat('%H:%M:%S', this.x) +': '+ this.y +' c';
						}//	format = pick(format, '%Y-%m-%d %H:%M:%S');
					},
					series: [{
						name: 'Hot Water',
						// Define the data points. All series have a dummy year
						// of 1970/71 in order to be compared on the same x axis. Note
						// that in JavaScript, months start at 0 for January, 1 for February etc.
						data: series0Data 
					}, {
						name: 'West Wing',
						data: series1Data 
					}, {
						name: 'West wall',
						data: series2Data 
					}]
				});
				
				
			});

